package cn.com.chengq.service;

import java.util.ServiceLoader;

/**
 * SPI功能示例代码
 * META-INF/services/[interface-class-name]文件
 * 1. 每行一个实现类
 */
public class App {
    public static void main(String[] args) {
        ServiceLoader<RandomService> serviceLoader = ServiceLoader.load(RandomService.class);
        for (RandomService service : serviceLoader) {
            System.out.println(service.getClass().toString());
        }
    }
}
